using System;
using FytSoa.Common.Utils;
using System.ComponentModel.DataAnnotations;
using FytSoa.Common.Enum;
using SqlSugar;

namespace FytSoa.Application.Erp;

/// <summary>
/// erp-采购退货
/// </summary>
public class ErpPurchaseReturnDto : AppEntity
{
    /// <summary>
    /// 采购退单编号
    /// </summary>
    public string Number { get; set; }

    /// <summary>
    /// 供应商编号
    /// </summary>
    [Required]
    public long SupplierId { get; set; }

    /// <summary>
    /// 供应商
    /// </summary>
    public ErpSupplierSimpleDto Supplier { get; set; } = new();

    /// <summary>
    /// 采购订单编号
    /// </summary>
    [Required]
    public long OrderId { get; set; }

    /// <summary>
    /// 采购订单信息
    /// </summary>
    public ErpPurchaseOrderSimpleDto Order { get; set; } = new();

    /// <summary>
    /// 退货金额
    /// </summary>
    [Required]
    public decimal Amount { get; set; }

    /// <summary>
    /// 退货日期
    /// </summary>
    [Required]
    public DateTime ReturnTime { get; set; } = DateTime.Now;

    /// <summary>
    /// 状态
    /// </summary>
    public ErpAuditEnum Status { get; set; } = 0;

    /// <summary>
    /// 备注
    /// </summary>
    public string Remark { get; set; }
    
    /// <summary>
    /// 审批流程
    /// </summary>
    [Required]
    public long FlowId { get; set; } = 0;

    /// <summary>
    /// 审批流程详情
    /// </summary>
    [Required]
    public ErpFlowDto.ErpFlowSimpleDto Flow { get; set; } = new();

    /// <summary>
    /// 创建人
    /// </summary>
    public string CreateUser { get; set; }

    /// <summary>
    /// 创建时间
    /// </summary>
    [Required]
    public DateTime CreateTime { get; set; } = DateTime.Now;

    /// <summary>
    /// 更新人
    /// </summary>
    public string UpdateUser { get; set; }

    /// <summary>
    /// 更新时间
    /// </summary>
    public DateTime? UpdateTime { get; set; }


}

/// <summary>
/// erp-采购退货订单
/// </summary>
public class ErpPurchaseReturnSimpleDto : AppEntity
{
    public string Number { get; set; }    
}